<?php

namespace App\Models\product;

use App\Models\BaseModel;

class ProductCourseModel extends BaseModel
{
    protected $table = 'product_course';
    protected $primaryKey = 'id';

    public static function getCourseType($value='')
    {
        $type = [
            1 => '分享',
            2 => '抖音',
            3 => '微信',
            4 => '快手',
        ];
        if ( is_numeric($value) && $value < 5 ) {
            return $type[$value];
        }
        if (is_string($value) && $value != '') {
            return array_search($value, $type);
        }
        return $type;
    }
}
